﻿@model PartsUnlimited.Models.IndexViewModel
@{
    ViewBag.Title = "Manage";
}
<section id="manage-page">
    <h2>@ViewBag.Title</h2>
    <p class="text-success">@ViewBag.StatusMessage</p>
    <div>
        <h4>Change your account settings</h4>
        <dl class="dl-horizontal">
            <dt>Email Address:</dt>
            <dd>@User.Identity.Name</dd>
            <dt>Password:</dt>
            <dd>
                [
                @if (Model.HasPassword)
            {
                    @Html.ActionLink("Change your password", "ChangePassword")
                }
                else
                {
                    @Html.ActionLink("Create", "SetPassword")
                }
                ]
            </dd>
            <dt>External Logins:</dt>
            <dd>
                @Model.Logins.Count [
                @Html.ActionLink("Manage", "ManageLogins") ]
            </dd>
            @*
                Phone Numbers can used as a second factor of verification in a two-factor authentication system.

                 See <a href="http://go.microsoft.com/fwlink/?LinkId=313242">this article</a>
                    for details on setting up this ASP.NET application to support two-factor authentication using SMS.

                 Uncomment the following block after you have set up two-factor authentication
            *@

            <dt>Phone Number:</dt>
            <dd>
                @(Model.PhoneNumber ?? "None") [
                @if (Model.PhoneNumber != null)
            {
                    @Html.ActionLink("Change", "AddPhoneNumber")
                    @: &nbsp;|&nbsp;
                    @Html.ActionLink("Remove", "RemovePhoneNumber")
                }
                else
                {
                    @Html.ActionLink("Add", "AddPhoneNumber")
                }
                ]
            </dd>
            <dt>Two-Factor Authentication:</dt>
            <dd>
                @if (Model.TwoFactor)
                {
                    using (Html.BeginForm("DisableTwoFactorAuthentication", "Manage", FormMethod.Post))
                    {
                        @Html.AntiForgeryToken()
                        <span>Enabled</span>
                        <span>[ <input type="submit" value="Disable" class="btn btn-link" /> ]</span>
                    }
                }
                else
                {
                    using (Html.BeginForm("EnableTwoFactorAuthentication", "Manage", FormMethod.Post))
                    {
                        @Html.AntiForgeryToken()
                        <span>Enabled</span>
                        <span>[ <input type="submit" value="Disable" class="btn btn-link" /> ]</span>
                    }
                }
            </dd>
            <dt>Browser remembered:</dt>
            <dd>
                @if (Model.BrowserRemembered)
            {
                using (Html.BeginForm("ForgetBrowser", "Manage", FormMethod.Post))
                {
                        @Html.AntiForgeryToken()
                            <span>Browser is curently remembered for two factor:</span>
                            <span>[ <input type="submit" value="Forget Browser" class="btn btn-link" /> ]</span>
                    }
                }
                else
                {
                    using (Html.BeginForm("RememberBrowser", "Manage", FormMethod.Post))
                    {
                        @Html.AntiForgeryToken()
                            <span>Browser is curently not remembered for two factor:</span>
                            <span>[ <input type="submit" value="Remember Browser" class="btn btn-link" /> ]</span>
                    }
                }
            </dd>
        </dl>
    </div>
</section>
